package com.example.zyh.controller;


import com.example.zyh.pojo.Xzl;
import com.example.zyh.service.XzlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@ResponseBody
@RequestMapping("/Xzl")
public class XzlController {
    @Autowired
    private XzlService xzlService;
    @RequestMapping("/list")
    public List<Xzl> select(){
        return xzlService.select();
    }
    @RequestMapping("/add")
    public void add(Xzl xzl){
        xzlService.addXzl(xzl);
    }
    @RequestMapping("/delete")
    public void delete(int id){
        xzlService.deleteXzl(id);
    }
    @RequestMapping("/update")
    public void update(Xzl xzl){
        xzlService.updateXzl(xzl);
    }

}
